package com.yesido.javabase.jichu.yunsuanfu;

/**
 * @author yesido
 * @description
 * @date 2023-06-27 17:29
 * @Version 8.3
 */
public class Test {
    public static void main(String[] args) {


        /**
         * ^异或运算
         */
        System.out.println(1^1);
        System.out.println(10^1);

        int data = 12345;
        int key = 98765;

// 加密
        int encrypted = data ^ key;

// 解密
        int decrypted = encrypted ^ key;

        System.out.println("原始数据：" + data);
        System.out.println("加密后的数据：" + encrypted);
        System.out.println("解密后的数据：" + decrypted);



        int num = 8;  // 要判断的数字

        if ((num ^ 1) == 0) {
            System.out.println(num + " 是偶数");
        } else {
            System.out.println(num + " 是奇数");
        }

    }
}
